package com.example.mapper;

import com.example.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


/**
 * Description:用户数据库操作
 * User: 阿宾
 * Date: 2025-05-14
 * Time: 08:34
 */
@Mapper
public interface UserInfoMapper {

    /**
     * 根据用户名，查询用户信息
     * @param userName
     * @return
     */
    @Select("select * from user_info where delete_flag = 0 and user_name = #{userName}")
    UserInfo selectByName(String userName);

    /**
     * 根据ID，查询用户信息
     * @param id
     * @return
     */
    @Select("select * from user_info where delete_flag = 0 and id = #{id}")
    UserInfo selectById(Integer id);

}
